package comExc;

/**
 * TEst
 *
 * @author byc
 * @date 2022-04-22
 */
public class Test {

    public void inputNum(int i) throws MyException{
        if (i == 1){
            throw new MyException("输入结果不能为1。");
        }
    }


    public static void main(String[] args) {

        Test test = new Test();
        int num = 1;
        try{
            test.inputNum(num);
            System.out.println("成功" + num);
        }catch (MyException e){
            e.printStackTrace();
            System.out.println(222);
        }
    }

}
